﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ClassLibrary.DAO;

public partial class Admin_ucControl_ucMenu : System.Web.UI.UserControl
{
    TblMenuDAO menuDAO = new TblMenuDAO(Global.CONNECTION_STRING);

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
       {
          //  loadmenu();
            loadGrid();
       }
    }

    //private void loadmenu()
    //{
    //    lvMenu.DataSource = menuDAO.GetAll();
    //    lvMenu.DataBind();
    //}

    private void loadGrid()
    {
        string id = Request.QueryString["id"];

        DataTable dt = new DataTable();
        dt = menuDAO.GetMenu_Wedding(Global.ConvertToInt(id));
        Accordion1.DataSource = dt.DefaultView;
        Accordion1.DataBind();
    }
  
    protected void Accordion1_ItemDataBound(object sender, AjaxControlToolkit.AccordionItemEventArgs e)
    {
        if (e.AccordionItem.ItemType == AjaxControlToolkit.AccordionItemType.Content)
        {
            DataTable dt = menuDAO.GetMenu_Wedding(2);
            Label label1 = (Label)e.AccordionItem.FindControl("Label1");
            
        }

    }
}
